home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / util / misc / car.lha / createaminetreadme / CreateAminetReadMe.rexx < prev   
OS/2 REXX Batch file  |  1999-01-21  |  14KB  |  353 lines

  1. /* $VER: CreateAminetReadMe.rexx 1.2 (1999-01-09) */
  2. options results
  3. R='0A'X
  4. call Tags()
  5. if arg(1)="ABOUT" then do
  6. options results;address CreateAminetReadMe
  7. window ID DOOS Title '"About CreateAminetReadMe v1.2"' ATTRS MUIA_Window_DragBar TRUE MUIA_Window_DepthGadget FALSE MUIA_Window_SizeGadget FALSE MUIA_Window_Borderless FALSE
  8. text,
  9. label "\033c\033bCreateAminetReadMe v1.2\033n\n\033cFreely Distributable Emailware\n\n\033cPlease visit my homepage:\nhttp://members.xoom.com/snorslex/\n\nPlease E-Mail me if you like/hate the program!\nSnorsleX@SoftHome.net\n\n\033r©Copyright 1998-1999 Lorens Johansson"
  10. group ATTRS MUIA_Group_Columns 3
  11. space horiz
  12. button ID CAB COMMAND '"CreateAminetReadMe.rexx CLOSEABOUT"' ATTRS MUIA_CycleChain 1 label "Okey"
  13. space horiz
  14. endgroup
  15. endwindow
  16. exit
  17. end
  18. if arg(1)="CLOSEABOUT" then do
  19. address CreateAminetReadMe
  20. window ID DOOS close
  21. exit
  22. end
  23. if arg(1)="SAVE" then do
  24. call Save
  25. exit
  26. end
  27. if arg(1)="LOAD" then do
  28. address CreateAminetReadMe
  29. popasl ID IN
  30. FILE = result
  31. if FILE = "" then do; say "You must select which file to load first!";exit;end
  32. if ~exists(FILE) then do; say "The file does not exist!";exit;end
  33. call open(load,FILE,"r")
  34. SH = "";AU = "";UP = "";TY = "";KU = "";RE = "";REQ = "";VE = "";DI = "0"
  35. do until eof(load)
  36. NOT = 0
  37. RAD = readln(load)
  38. RAD2 = left(RAD,4)
  39. if RAD2 = "Shor" then do
  40. NOT = 1
  41. SH = delstr(RAD, 1, 10)
  42. end
  43. if RAD2 = "Auth" then do
  44. NOT = 1
  45. AU = delstr(RAD, 1, 10)
  46. end
  47. if RAD2 = "Uplo" then do
  48. NOT = 1
  49. UP = delstr(RAD, 1, 10)
  50. end
  51. if RAD2 = "Vers" then do
  52. NOT = 1
  53. VE = delstr(RAD, 1, 10)
  54. end
  55. if RAD2 = "Type" then do
  56. NOT = 1
  57. TY = delstr(RAD, 1, 10)
  58. end
  59. if RAD2 = "Kurz" then do
  60. NOT = 1
  61. KU = delstr(RAD, 1, 10)
  62. end
  63. if RAD2 = "Repl" then do
  64. NOT = 1
  65. RE = delstr(RAD, 1, 10)
  66. end
  67. if RAD2 = "Requ" then do
  68. NOT = 1
  69. REQ = delstr(RAD, 1, 10)
  70. end
  71. if RAD2 = "Dist" then do
  72. NOT = 1
  73. DI = delstr(RAD, 1, 14)
  74. if DI = "" then DI = 0
  75. if DI = "NoCDs" then DI = 1
  76. if DI = "Aminet" then DI = 2
  77. end
  78. if NOT = 0 then do
  79. line = RAD
  80. WRITE = TRUE
  81. call open(desc,"t:car.desc",W)
  82. do until eof(load)
  83. if line = "============================= Archive contents =============================" then WRITE = FALSE
  84. if WRITE = TRUE then call writeln(desc,line)
  85. line = readln(load)
  86. end
  87. call close(desc)
  88. end
  89. end
  90. call close(load)
  91. address CreateAminetReadMe
  92. string ID SHORT content SH
  93. string ID AUTHO content AU
  94. string ID UPLOA content UP
  95. poplist ID ULTYP content TY
  96. string ID KURZ content KU
  97. string ID REPLA content RE
  98. string ID REQUI content REQ
  99. string ID VERSI content VE
  100. radio ID DIST ATTRS MUIA_Radio_Active DI
  101. exit
  102. end
  103. if arg(1)="PREFS" then do
  104. call Prefs
  105. exit
  106. end
  107. address CreateAminetReadMe
  108. window ID DOOM TITLE '"CreateAminetReadMe v1.2"' COMMAND '"quit"' PORT CreateAminetReadMe ATTRS MUIA_Window_ScreenTitle '"CreateAminetReadMe 1.2          ©1998-1999 Lorens Johansson Freely Distributable Emailware"'
  109. menu LABEL "CreateAminetReadMe"
  110. item COMMAND '"method 'MUIM_Application_OpenConfigWindow'"' PORT CreateAminetReadMe ATTRS MUIA_Menuitem_Shortcut 'P' LABEL "MUI Prefs..."
  111. item COMMAND '"CreateAminetReadMe.rexx PREFS"' ATTRS MUIA_Menuitem_Shortcut 'S' LABEL "Save Prefs"
  112. item ATTRS MUIA_Menuitem_Title '-1'
  113. item COMMAND '"method 'MUIM_Application_AboutMUI' 0"' PORT CreateAminetReadMe  ATTRS MUIA_Menuitem_Shortcut 'M' LABEL "About MUI"
  114. item COMMAND '"CreateAminetReadMe.rexx ABOUT"' ATTRS MUIA_Menuitem_Shortcut 'A' LABEL "About"
  115. item ATTRS MUIA_Menuitem_Title '-1'
  116. item COMMAND '"quit"' PORT CreateAminetReadMe ATTRS MUIA_Menuitem_Shortcut 'Q' LABEL "Quit"
  117. endmenu
  118. group ATTRS MUIA_Group_Columns 2
  119. text help '"CreateAminetReadMe v1.2 by\nLorens Johansson (http://members.xoom.com/snorslex)\nIf you use this program, you are required to\nEmail the author (SnorsleX@SoftHome.net). Otherwise,\nhow is he supposed to know to keep supporting\nCreateAminetReadMe ?!?\n\033rLorens Johansson"' label "\033c\033bCreateAminetReadMe v1.2\033n\n\033cLorens Johansson\n\033cFreely Distributable Emailware"
  120. text ICON '"CreateAminetReadMe"'
  121. endgroup
  122. endgroup
  123. group REGISTER ATTRS MUIA_CycleChain 1 LABELS "Required,Additional,Other"
  124. group HORIZ
  125. group ATTRS MUIA_Group_Columns 2
  126. label "Short:"
  127. string ID SHORT ATTRS MUIA_CycleChain 1 MUIA_String_MaxLen 41 help '"The programs short description."'
  128. label "Author:"
  129. string ID AUTHO ATTRS MUIA_CycleChain 1 help '"The authors name and email."'
  130. label "Uploader:"
  131. string ID UPLOA ATTRS MUIA_CycleChain 1 help '"The uploaders name and email."'
  132. label "Upload type:"
  133. poplist ID ULTYP ATTRS MUIA_CycleChain 1 help '"In which directory your program will be put."' labels "
  134. biz/cloan,biz/cross,biz/dbase,biz/demo,biz/dopus,biz/haage,biz/misc,biz/p5,biz/patch,biz/swood,
  135. comm/amiex,comm/bbs,comm/cnet,comm/dlg,comm/fido,comm/irc,comm/mail,comm/maxs,comm/misc,comm/mmgr,comm/net,comm/news,comm/tcp,comm/thor,comm/ums,comm/uucp,comm/www,comm/xeno,
  136. demo/40k,demo/aga,demo/bse,demo/euro,demo/file,demo/intro,demo/mag,demo/slide,demo/sound,demo/ta97,
  137. dev/amos,dev/asm,dev/basic,dev/c,dev/cross,dev/debug,dev/e,dev/gcc,dev/gui,dev/lang,dev/m2,dev/misc,dev/moni,dev/mui,dev/src,
  138. disk/bakup,disk/cache,disk/cdrom,disk/misc,
  139. docs/anno,docs/help,docs/hyper,docs/lists,docs/mags,docs/misc,docs/rview,
  140. game/play,game/actio,game/board,game/data,game/demo,game/gag,game/hint,game/jump,game/misc,game/patch,game/role,game/shoot,game/text,game/think,game/wb,
  141. gfx/3d,gfx/3dobj,gfx/aga,gfx/board,gfx/conv,gfx/edit,gfx/misc,gfx/pbm,gfx/show,
  142. hard/drivr,hard/hack,hard/misc,
  143. misc/edu,misc/emu,misc/kids,misc/math,misc/misc,misc/sci,misc/unix,
  144. mods/8voic,mods/atmos,mods/demo,mods/elbie,mods/funk,mods/hardc,mods/house,mods/instr,mods/jungl,mods/k4k,mods/med,mods/melod,mods/misc,mods/mpg,mods/neuro,mods/nork,mods/piano,mods/pop,mods/pro,mods/rock,mods/roz,mods/sets,mods/slow,mods/smpl,mods/sonor,mods/symph,mods/techn,mods/toady,mods/tranc,mods/voice,mods/xceed,mods/xm,
  145. mus/edit,mus/midi,mus/misc,mus/play,
  146. pix/3dani,pix/anim,pix/art,pix/back,pix/boot,pix/eric,pix/fract,pix/heiko,pix/icon,pix/illu,pix/imagi,pix/irc,pix/jason,pix/misc,pix/mpg,pix/mwb,pix/nicon,pix/trace,pix/vehic,pix/views,pix/wb,
  147. text/bfont,text/dtp,text/edit,text/font,text/hyper,text/misc,text/print,text/show,
  148. util/app,util/arc,util/batch,util/blank,util/boot,util/cdity,util/cli,util/conv,util/crypt,util/dir,util/dtype,util/libs,util/misc,util/moni,util/pack,util/rexx,util/shell,util/sys,util/time,util/virus,util/wb"
  149. endgroup
  150. group frame label "Distribution"
  151. radio ID DIST ATTRS MUIA_CycleChain 1 help '"Which distribution method you want for your program."' labels "Ignore,NoCDs,Aminet"
  152. endgroup
  153. endgroup
  154. group ATTRS MUIA_Group_Columns 2
  155. label "Kurz:"
  156. string ID KURZ ATTRS MUIA_CycleChain 1 help '"Short description. In GERMAN."'
  157. label "Replaces:"
  158. string ID REPLA ATTRS MUIA_CycleChain 1 help '"Enter the file that this file replaces on Aminet."'
  159. label "Requires:"
  160. string ID REQUI ATTRS MUIA_CycleChain 1 help '"Enter files that are required by your program."'
  161. label "Version:"
  162. string ID VERSI ATTRS MUIA_CycleChain 1 help '"The version of your program."'
  163. endgroup
  164. group
  165. group ATTRS MUIA_Group_Columns 2
  166. button ATTRS MUIA_CycleChain 1 help '"Edit your description."' COMMAND """c:ed t:car.desc""" PORT COMMAND LABEL "Edit description"
  167. button ATTRS MUIA_CycleChain 1 help '"Delete your description."' COMMAND """c:delete t:car.desc quiet""" PORT COMMAND LABEL "Delete description"
  168. endgroup
  169. group ATTRS MUIA_Group_Columns 2
  170. label "LHA Exe:"
  171. popasl ID LHAEX ATTRS MUIA_CycleChain 1 ASLFR_DoPatterns 1 ASLFR_RejectIcons 1 ASLFR_TitleText "Select LHA executable..."  help '"The path to lha and the executable."'
  172. label "Archive:"
  173. popasl ID ARC ATTRS MUIA_CycleChain 1 ASLFR_InitialPattern "#?.lha" ASLFR_DoPatterns 1 ASLFR_RejectIcons 1 ASLFR_TitleText "Select LHA archive..." help '"The path and name to the archive that you want to be listed in the ReadMe."'
  174. endgroup
  175. group ATTRS MUIA_Group_Columns 2
  176. label "Write archive contents:"
  177. cycle ID WARCC ATTRS MUIA_CycleChain 1 help '"Should the archive contents be written to the ReadMe?"' labels "Yes,No"
  178. endgroup
  179. endgroup
  180. endgroup
  181. group ATTRS MUIA_Group_Columns 3
  182. label "Output ReadMe:"
  183. popasl ID OUT ATTRS MUIA_CycleChain 1 ASLFR_DoPatterns 1 ASLFR_DoSaveMode 1 ASLFR_RejectIcons 1 ASLFR_TitleText "Save ReadMe..." help '"Choose where the ReadMe will be created/saved."'
  184. button ID SAVE ATTRS MUIA_CycleChain 1 help '"Saves the ReadMe."' COMMAND """CreateAminetReadMe.rexx SAVE""" label "Save ReadMe"
  185. label "Input ReadMe:"
  186. popasl ID IN ATTRS MUIA_CycleChain 1 ASLFR_InitialPattern "#?.ReadMe" ASLFR_DoPatterns 1 ASLFR_RejectIcons 1 ASLFR_TitleText "Load ReadMe..." help '"Choose the ReadMe that should be loaded."'
  187. button ID LOAD ATTRS MUIA_CycleChain 1 help '"Loads the chosen ReadMe."' COMMAND """CreateAminetReadMe.rexx LOAD""" label "Load ReadMe"
  188. endgroup
  189. group ATTRS MUIA_Group_Columns 5
  190. button ID PREF ATTRS MUIA_CycleChain 1 help '"Saves the preferences."' COMMAND """CreateAminetReadMe.rexx PREFS""" label "Save Prefs"
  191. space horiz
  192. button ID ABT ATTRS MUIA_CycleChain 1 help '"Shows some info about CreateAminetReadMe."' COMMAND """CreateAminetReadMe.rexx ABOUT""" label "About"
  193. space horiz
  194. button ID QUIT ATTRS MUIA_CycleChain 1 help '"Quits CreateAminetReadMe."' COMMAND '"quit"' PORT CreateAminetReadMe label "Quit"
  195. endgroup
  196. endwindow
  197. call LoadPrefs
  198. Address CreateAminetReadMe
  199. EXIT
  200. Tags:
  201. ASLFR_DoPatterns = 0x8008002E
  202. ASLFR_DoSaveMode = 0x8008002C
  203. ASLFR_InitialPattern = 0x8008000A
  204. ASLFR_RejectIcons = 0x8008003C
  205. ASLFR_TitleText = 0x80080001
  206. MUIA_CycleChain = 0x80421ce7
  207. MUIA_Group_Columns = 0x8042f416
  208. MUIA_Group_Horiz = 0x8042536b
  209. MUIA_Group_Rows = 0x8042b68f
  210. MUIA_Menuitem_Title = 0x804218be
  211. MUIA_Menuitem_Shortcut = 0x80422030
  212. MUIA_Radio_Active = 0x80429b41
  213. MUIA_Selected = 0x8042654b
  214. MUIA_String_MaxLen = 0x80424984
  215. MUIA_Window_Borderless = 0x80429b79
  216. MUIA_Window_DepthGadget = 0x80421923
  217. MUIA_Window_DragBar = 0x8042045d
  218. MUIA_Window_ScreenTitle = 0x804234b0
  219. MUIA_Window_SizeGadget = 0x8042e33d
  220. MUIM_Application_AboutMUI = 0x8042d21d
  221. MUIM_Application_OpenConfigWindow = 0x804299ba
  222. TRUE = 1
  223. FALSE = 0
  224. Return 0
  225. Save:
  226. address CreateAminetReadMe
  227. popasl ID OUT
  228. OUTPUT = result
  229. if OUTPUT = "" then do;say "You must enter where the ReadMe shall be created!";exit;end
  230. string ID SHORT
  231. SHORT = result
  232. string ID AUTHO
  233. AUTHO = result
  234. string ID UPLOA
  235. UPLOA = result
  236. string ID VERSI
  237. VERSI = result
  238. poplist ID ULTYP
  239. ULTYP = result
  240. string ID KURZ
  241. KURZ = result
  242. string ID REPLA
  243. REPLA = result
  244. string ID REQUI
  245. REQUI = result
  246. radio ID DIST
  247. DIST = result
  248. if SHORT = "" then do;say "You must fill out the Short field!";exit;end
  249. if AUTHO = "" then do;say "You must fill out the Author field!";exit;end
  250. if UPLOA = "" then do;say "You must fill out the Uploader field!";exit;end
  251. if ULTYP = "" then do;say "You must fill out the Upload Type field!";exit;end
  252. call open(readme,OUTPUT,"w")
  253. call writeln(readme,"Short:    "||SHORT)
  254. call writeln(readme,"Author:   "||AUTHO)
  255. call writeln(readme,"Uploader: "||UPLOA)
  256. if VERSI ~= "" then call writeln(readme,"Version:  "||VERSI)
  257. call writeln(readme,"Type:     "||ULTYP)
  258. if KURZ ~= "" then call writeln(readme,"Kurz:     "||KURZ)
  259. if REPLA ~= "" then call writeln(readme,"Replaces: "||REPLA)
  260. if REQUI ~= "" then call writeln(readme,"Required: "||REQUI)
  261. if DIST ~= "Ignore" then call writeln(readme,"Distribution: "||DIST)
  262. if exists("t:car.desc") = 1 then do
  263. call writeln(readme,"")
  264. call open(desc,"t:car.desc","r")
  265. do until eof(desc)
  266. line = readln(desc)
  267. call writeln(readme,line)
  268. end
  269. call close(desc)
  270. end
  271. cycle ID WARCC
  272. WARCC = result
  273. if WARCC = "Yes" then do
  274. popasl ID LHAEX
  275. LHAEX = result
  276. if LHAEX = "" then do;say "You must enter tha path to the lha executeable!";exit;end
  277. if ~exists(LHAEX) then do;say "Could not find the LHA executable!";exit;end
  278. popasl ID ARC
  279. ARC = result
  280. if ARC = "" then do;say "You must select the archive!";exit;end
  281. if ~exists(ARC) then do;say "Could not find the archive!";exit;end
  282. ADDRESS COMMAND LHAEX||" l "||ARC||" > T:lha.list"
  283. call writeln(readme,"")
  284. call writeln(readme,"============================= Archive contents =============================")
  285. call writeln(readme,"")
  286. call open(list,"t:lha.list","r")
  287. do until eof(list)
  288. line = readln(list)
  289. call writeln(readme,line)
  290. end
  291. call close(list)
  292. end
  293. call writeln(readme,"")
  294. call writeln(readme,"Created Using CreateAminetReadMe by Lorens Johansson.")
  295. call close(readme)
  296. return 0
  297. LoadPrefs:
  298. if exists("CAR.Prefs") then do
  299. call open(prefs,"CAR.prefs","r")
  300. address CreateAminetReadMe
  301. string ID SHORT content readln(prefs)
  302. string ID AUTHO content readln(prefs)
  303. string ID UPLOA content readln(prefs)
  304. poplist ID ULTYP content readln(prefs)
  305. radio ID DIST ATTRS MUIA_Radio_Active readln(prefs)
  306. string ID KURZ content readln(prefs)
  307. string ID REPLA content readln(prefs)
  308. string ID REQUI content readln(prefs)
  309. string ID VERSI content readln(prefs)
  310. popasl ID LHAEX content readln(prefs)
  311. popasl ID ARC content readln(prefs)
  312. cycle ID WARCC ATTRS MUIA_Cycle_Active readln(prefs)
  313. call close(prefs)
  314. end
  315. return 0
  316. Prefs:
  317. address CreateAminetReadMe
  318. call open(save,CAR.prefs,"w")
  319. string ID SHORT
  320. SHORT = result
  321. call writeln(save,SHORT)
  322. string ID AUTHO
  323. call writeln(save,result)
  324. string ID UPLOA
  325. call writeln(save,result)
  326. poplist ID ULTYP
  327. call writeln(save,result)
  328. radio ID DIST
  329. DIST = result
  330. if DIST = "Ignore" then DIST = 0
  331. if DIST = "NoCDs" then DIST = 1
  332. if DIST = "Aminet" then DIST = 2
  333. call writeln(save,DIST)
  334. string ID KURZ
  335. call writeln(save,result)
  336. string ID REPLA
  337. call writeln(save,result)
  338. string ID REQUI
  339. call writeln(save,result)
  340. string ID VERSI
  341. call writeln(save,result)
  342. popasl ID LHAEX
  343. call writeln(save,result)
  344. popasl ID ARC
  345. call writeln(save,result)
  346. cycle ID WARCC
  347. WARCC = result
  348. if WARCC = "Yes" then WARCC = 0
  349. if WARCC = "No" then WARCC = 1
  350. call writeln(save,WARCC)
  351. call close(save)
  352. return 0
  353.